from datetime import datetime


def get_current_date():
    return get_current_date_by_pattern('%Y-%m-%d %H:%M:%S')


def get_current_date_by_pattern(format_pattern: str):
    current = datetime.now()
    return current.strftime(format_pattern)


def days_between_dates(date1,date2=datetime.now()):
    date1 = datetime.strptime(date1, '%Y-%m-%d')
    return (date2 - date1).days
